#ifndef CALCULATORWIDGET_H
#define CALCULATORWIDGET_H

#include <QSplitter>
#include <QTextEdit>
#include "caltextedit.h"
#include "caltoolwidget.h"

class CalculatorWidget : public QSplitter
{
public:
    CalculatorWidget(QWidget *parent = 0);
    CalTextEdit *getEditor()
    {
        return editor;
    }
    void fileNew();
    void fileOpen(QString);
    bool fileSave();
    bool fileSaveAs();
    bool load(const QString &f);

private:
    bool maybeSave();
    void setCurrentFileName(const QString &fileName);
    QString fileName;
    void setupEditor();
    CalTextEdit *editor;
    CalToolWidget *toolWidget;
};

#endif // CALCULATORWIDGET_H
